package com.wlyuan.open.domain.client.respository;

import com.wlyuan.core.domain.repository.BaseRepository;
import com.wlyuan.open.domain.client.OpenClient;
import com.wlyuan.open.domain.client.OpenClientId;
import com.wlyuan.open.domain.client.OpenClientPattern;
import com.wlyuan.open.dto.api.OpenClientFilterDTO;
import com.wlyuan.utils.Page;

import java.util.List;

/**
 * @author yuanzheng
 */
public interface OpenClientRepository extends BaseRepository<OpenClient, OpenClientId> {
    /**
     * 根据appId查询信息
     *
     * @param appId
     * @return
     */
    OpenClient ofAppId(String appId);

    /**
     * 条件查询
     *
     * @param patter
     * @return
     */
    OpenClient ofPattern(OpenClientPattern patter);

    /**
     * 根据tenantId查询信息
     */
    OpenClient ofTenantId(Long tenantId, Long userId);

    List<OpenClient> ofPatternName(OpenClientPattern pattern);

    OpenClient ofPatternMobile(OpenClientPattern pattern);

    List<OpenClient> ofAll();

    Page<OpenClientId> search(OpenClientFilterDTO filter);

}
